package com.tyk.bookstore.back.system.valid.constant;

import org.springframework.http.MediaType;

import java.util.regex.Pattern;

/**
 * @author tyk
 * @description UserValidConstant
 */
public class UserValidConstant {

    /**
     * 用户账号
     */
    public static final int ACCOUNT_MIN_LENGTH = 4;

    public static final int ACCOUNT_MAX_LENGTH = 20;

    public static final String ACCOUNT_REGEXP = "^[a-zA-Z]\\w{3,19}$";

    public static final Pattern ACCOUNT_PATTERN = Pattern.compile(ACCOUNT_REGEXP);

    /**
     * 用户密码
     */
    public static final int PASSWORD_MIN_LENGTH = 4;

    public static final int PASSWORD_MAX_LENGTH = 20;

    public static final String PASSWORD_REGEXP = "^\\w{4,20}$";

    public static final Pattern PASSWORD_PATTERN = Pattern.compile(PASSWORD_REGEXP);

    /**
     * 用户头像
     */
    public static final String AVATAR_FILE_TYPE = MediaType.IMAGE_PNG_VALUE;

    public static final int AVATAR_MAX_SIZE = 2 * 1024 * 1024;

    public static final int AVATAR_WIDTH = 200;

    public static final int AVATAR_HEIGHT = 200;

}
